<template>
	<view class="page">
		<view class="wrapper">
			<view class="list">
				<view class="msg" v-for="i in notice" :key="i.id" @click="goto('/pages/mine/msg?id=' + i.id)">
					<view class="top">
						<view class="type">
							{{i.title}}
						</view>
						<view class="time">
							{{i.created_at}}
						</view>
					</view>
					<view class="info">
						{{i.content}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				notice: []
			};
		},
		onLoad() {
			this.getNotice();
		},
		methods: {
			goto(path) {
				uni.navigateTo({
					url: path,
					animationType: 'slide-in-right',
					animationDuration: 300
				})
			},
			getNotice() {
				this.$u.get('/notice/list').then(res => {
					this.notice = res.data.result.notice
				})
			}
		}
	}
</script>

<style lang="scss">
	.msg {
		background: #141439;
		padding: 30rpx;
		margin-top: 30rpx;
		font-size: 34rpx;
		border-radius: 10rpx;
		.top {
			display: flex;
			justify-content: space-between;
			color: #fff;
			margin-bottom: 30rpx;
		}
		.info {
			display: -webkit-box;
			overflow: hidden;
			text-overflow: ellipsis;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
		}
	}
</style>
